﻿using Dropit.Extension.Core;
using SocialPack.Composer.Extensions;

namespace SocialPack.Composer.modules.SocialPack.Composer.Functions.Twitter
{
    public partial class FollowButton : BaseContentFunction
    {
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            if (ContentFunctionData.IsValue("ShowFollowerCount"))
            {
                this.FollowButtonControl.ShowFollowerCount = (bool)ContentFunctionData.Property["ShowFollowerCount"].Value;
            }

            if (ContentFunctionData.IsValue("TwitterName"))
            {
                this.FollowButtonControl.TwitterName = ContentFunctionData.Property["TwitterName"].ToString();
            }

            if (ContentFunctionData.IsValue("Language"))
            {
                this.FollowButtonControl.Language = ContentFunctionData.Property["Language"].ToString();
            }
        }
    }
}